/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.service.payment.provider.cybersource;

import net.martinimix.domain.payment.CreditCardAuthorization;

/**
 * Provides an authorization decision manager interface.  An authorization decision
 * manager is responsible for determining whether or not a credit card authorization
 * is accepted or rejected.
 * 
 * 
 * @author Scott Rossillo
 *
 */
public interface AuthorizationDecisionManager {
	
	/**
	 * Returns true if the given authorization should be treated as a positive response.
	 * <p>
	 * Implementations should not use {@link CreditCardAuthorization#isPositiveResponse()}
	 * to determine if the authorization is positive.  The authorization response is only 
	 * set as positive if this method returns true.
	 * </p>
	 * 
	 * @param authorization the <code>CreditCardAuthorization</code> to be checed
	 * 
	 * @return <code>true</code> if the given <code>authorization</code> should be treated
	 * as a positive response; <code>false</code> otherwise
	 */
	public boolean acceptAuthorization(CreditCardAuthorization authorization);

}
